﻿using ReNameEx.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using static System.Net.Mime.MediaTypeNames;

namespace ReNameEx.SubPage
{
    /// <summary>
    /// SortRulePage.xaml 的交互逻辑
    /// </summary>
    public partial class SortRulePage : RulePage
    {
        public SortRulePage()
        {
            InitializeComponent();
        }


        public override ReExRuleBase GetConfig()
        {
            var result = new SortRule()
            {
                InsertIndex = InsertIndex.Text.ToInt32(),
                StartNum = StartNum.Text.ToInt32(),
                Increment = Increment.Text.ToInt32(),
                Replication = Replication.Text.ToInt32(),
                ZeroFill = ZeroFill.Text.ToInt32(),
                ResetInterval = ResetInterval.Text.ToInt32(),
            };
            switch (SortData.SelectedIndex)
            {
                case 0:
                    result.SortData = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"];
                    break;
                case 1:
                    result.SortData = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"];
                    break;
                case 2:
                    result.SortData = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"];
                    break;
            }
            return result;
        }
    }
}
